package com.kcl.dfss;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.CalendarView;
import android.widget.CalendarView.OnDateChangeListener;
public class CalendarActivity extends Activity{
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_calendar);
		
		CalendarView calendar = (CalendarView)findViewById(R.id.calendar);
		calendar.setOnDateChangeListener(new OnDateChangeListener() {
			
			@Override
			public void onSelectedDayChange(CalendarView view, int year, int month,
					int dayOfMonth) {
				// TODO Auto-generated method stub
				Intent data = new Intent();
				data.putExtra("year", year);
				data.putExtra("month", month);
				data.putExtra("day", dayOfMonth);
				setResult(RESULT_OK, data);
				finish();
			}
		});
	}
}
